package com.newdjk.newdoctor.adapter;


import android.text.TextUtils;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.google.gson.Gson;
import com.newdjk.newdoctor.R;
import com.newdjk.newdoctor.utils.GlideUtils;
import com.newdjk.okhttp.entity.HotShopEntity;
import com.newdjk.okhttp.entity.YunyiYouxuanEntity;

import java.util.List;

public class YouxuanAdapter extends BaseQuickAdapter<YunyiYouxuanEntity.GoodsListBean, BaseViewHolder> {
    private String TAG = "MyDiagnoseImageAdapter";
    private Gson mGson;
    private List<YunyiYouxuanEntity.GoodsListBean> datalist;
    private int type=0;


    public YouxuanAdapter(@Nullable List<YunyiYouxuanEntity.GoodsListBean> data) {
        super(R.layout.youxuan_function_item, data);

        datalist = data;
        mGson = new Gson();
        this.type=type;
    }

    @Override
    protected void convert(BaseViewHolder helper, final YunyiYouxuanEntity.GoodsListBean item) {
        ImageView avatar = helper.getView(R.id.im_picture);

        GlideUtils.loadMedicaineCommonmage(item.getMainUrls(), avatar);
        String serviceName = item.getGoodsName();
        String price = item.getVipPrice();
        String serviceprice = item.getServiceFee();
        helper.setText(R.id.tv_med_name,  TextUtils.isEmpty(serviceName)?"":serviceName);

        helper.setText(R.id.tv_price, ""+price + "");

        helper.setText(R.id.tv_service_price, "服务费：￥"+(TextUtils.isEmpty(serviceprice)?"":serviceprice) + "");

    }
}
